<?php
namespace App\Api\Controllers\V1;

use App\Api\Controllers\Validators\ClassifyValidator;
use App\Api\Helper\ReturnMessage;
use App\Models\api\Classify;
use Illuminate\Http\Request;

class ClassifyController extends BaseController
{
	/**
	 * 获取类别数据
	 * @author yuxingkui
	 * @param $request
	 * @return mixed
	 * */
	public function Classify( Request $request )
	{
		$input = ClassifyValidator::getClassify($request);

		$classify = Classify::getClassify($input);
		$fname=array(
				'id'=>'id',
				'name'=>'name',
				'parent_id'=>'parent_id',
				'sort'=>'sort',
				'icon'=>'icon',
				'status'=>'status',
		);
		$classify=resetFieldArr($fname,$classify);
		return ReturnMessage::successData($classify);

	}
}